<!--
 * createor: zc
 * email: zc8023zs@163.com
 * create_time: 2020/3/14 13:46:24
 *-->
<template>
  <el-container>
    <el-header>
      用户佣金汇总表详情
    </el-header>
    <el-main>
      <el-form label-width="200px" :inline="true" style="padding:5% 5% 0 5%">
        <el-form-item label="id：">
          <span>{{formData.id}}</span>
        </el-form-item>
        <el-form-item label="用户id：">
          <span>{{formData.user_id}}</span>
        </el-form-item>
        <el-form-item label="类型 1日 2月：">
          <span>{{formData.type}}</span>
        </el-form-item>
        <el-form-item label="日期：">
          <span>{{formData.date}}</span>
        </el-form-item>
        <el-form-item label="收入：">
          <span>{{formData.income}}</span>
        </el-form-item>
        <el-form-item label="支出：">
          <span>{{formData.expenditure}}</span>
        </el-form-item>
        <el-form-item label="收入笔数：">
          <span>{{formData.income_count}}</span>
        </el-form-item>
        <el-form-item label="支出笔数：">
          <span>{{formData.expenditure_count}}</span>
        </el-form-item>
      </el-form>
    </el-main>
  </el-container>
</template>
<style scoped>
body .app-container .el-container,
body .app-container .el-header,
body .app-container .el-main,
body .el-container,
body .el-header,
body .el-main {
  padding: 0;
  -webkit-box-sizing: border-box;
  box-sizing: border-box;
}
</style>
<script>
import { Loading } from "element-ui";
import {
  jbr_user_commissionInfo
} from '@/api/project/wmyh/project_wmyh_jbr_user_commission'
export default {
  name: "a_wmyha_jbr_user_commission_info",
  data() {
    return {
      infoLoading: false,
      formData:{
        id: 0, 
        user_id: 0, 
        type: 0, 
        date: '2020/8/11 10:52:36', 
        income: 0.0, 
        expenditure: 0.0, 
        income_count: 0, 
        expenditure_count: 0, 
      }
    };
  },
  activated() {
    var result = location.search.match(new RegExp("[\?\&]id=([^\&]+)", "i"));
    if(result != null || result.length > 0){
      this.onInfo(result[1]);
    }
  },
  methods: {
    onInfo(id){
      this.infoLoading=true;
      jbr_user_commissionInfo({id:id}).then(r=>{
        this.formData.id = r.dataSingle.id, 
        this.formData.user_id = r.dataSingle.user_id, 
        this.formData.type = r.dataSingle.type, 
        this.formData.date = r.dataSingle.date, 
        this.formData.income = r.dataSingle.income, 
        this.formData.expenditure = r.dataSingle.expenditure, 
        this.formData.income_count = r.dataSingle.income_count, 
        this.formData.expenditure_count = r.dataSingle.expenditure_count, 
        this.infoLoading=false;
      }).catch(()=>{
        this.infoLoading=false;
      });
    }
  }
}
</script>
